package ogltest1;

import javax.media.opengl.*;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import com.sun.opengl.util.Animator;


public class Test
{
	public static void main( String[] args )
    {
		System.out.println( System.getProperty("java.library.path") );

        try
        {
            Frame testFrame = new Frame("TestFrame");
            testFrame.setSize( 512, 384 );
            
            
            GLCapabilities caps = new GLCapabilities();
            caps.setRedBits(8);
            caps.setBlueBits(8);
            caps.setGreenBits(8);
            caps.setAlphaBits(8);
            caps.setHardwareAccelerated(true);
            
            GLCanvas canvas = new GLCanvas(caps);


            testFrame.add( canvas );

            canvas.addGLEventListener(new TestRenderer());

            final Animator animator = new Animator( canvas);
            testFrame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                  animator.stop();
                  System.exit(0);
                }
              });
            testFrame.show();
            animator.start();
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
    }

}
